// @ts-ignore
/* eslint-disable */
import {request} from '@umijs/max';

/** addUser POST /api/user/add */
export async function addUserUsingPOST(body: API.UserAddRequest, options?: { [key: string]: any }) {
    return request<API.BaseResponseLong_>('/api/user/add', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
        },
        data: body,
        ...(options || {}),
    });
}

/** deleteUser POST /api/user/delete */
export async function deleteUserUsingPOST(
    body: API.DeleteRequest,
    options?: { [key: string]: any },
) {
    return request<API.BaseResponseBoolean_>('/api/user/delete', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
        },
        data: body,
        ...(options || {}),
    });
}

/** getUserById GET /api/user/get */
export async function getUserByIdUsingGET(
    // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
    params: API.getUserByIdUsingGETParams,
    options?: { [key: string]: any },
) {
    return request<API.BaseResponseUser_>('/api/user/get', {
        method: 'GET',
        params: {
            ...params,
        },
        ...(options || {}),
    });
}

/** getLoginUser GET /api/user/get/login */
export async function getLoginUserUsingGET(options?: { [key: string]: any }) {
    return request<API.BaseResponseLoginUserVO_>('/api/user/get/login', {
        method: 'GET',
        ...(options || {}),
    });
}

/** getUserVOById POST /api/user/get/vo */
export async function getUserVOByIdUsingPOST(
    // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
    body: API.QueryIdDTO,
    options?: { [key: string]: any },
) {
    return request<API.BaseResponseUserVO_>('/api/user/get/vo', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
        },
        data: body,
        ...(options || {}),
    });
}

/** listUserByPage POST /api/user/list/page */
export async function listUserByPageUsingPOST(
    body: API.UserQueryRequest,
    options?: { [key: string]: any },
) {
    return request<API.BaseResponsePageUser_>('/api/user/list/page', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
        },
        data: body,
        ...(options || {}),
    });
}

/** listUserVOByPage POST /api/user/list/page/vo */
export async function listUserVOByPageUsingPOST(
    body: API.UserQueryRequest,
    options?: { [key: string]: any },
) {
    return request<API.BaseResponsePageUserVO_>('/api/user/list/page/vo', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
        },
        data: body,
        ...(options || {}),
    });
}

/** userLogin POST /api/user/login */
export async function userLoginUsingPOST(
    body: API.UserLoginRequest,
    options?: { [key: string]: any },
) {
    return request<API.BaseResponseLoginUserVO_>('/api/user/login', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
        },
        data: body,
        ...(options || {}),
    });
}

/** userLogout POST /api/user/logout */
export async function userLogoutUsingPOST(options?: { [key: string]: any }) {
    return request<API.BaseResponseBoolean_>('/api/user/logout', {
        method: 'POST',
        ...(options || {}),
    });
}

/** userAuthLogin POST /api/user/login/{srouce} */
export async function userAuthLoginUsingPOST(
    source: API.LoginSource,
    options?: { [key: string]: any },
) {
    return request<API.LoginSource>(`/api/user/login/${source}`, {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
        },
        ...(options || {}),
    });
}

/** userRegister POST /api/user/register */
export async function userRegisterUsingPOST(
    body: API.UserRegisterRequest,
    options?: { [key: string]: any },
) {
    return request<API.BaseResponseLong_>('/api/user/register', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
        },
        data: body,
        ...(options || {}),
    });
}

/** userRegister POST /api/user/forget */
export async function userForgetPassword(
    body: API.UserRegisterRequest,
    options?: { [key: string]: any },
) {
    return request<API.BaseResponseLong_>('/api/user/forget', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
        },
        data: body,
        ...(options || {}),
    });
}

/** userSend POST /api/user/sms/send */
export async function userSendUsingGET(
    {phoneOrEmail} ,
    options?: { [key: string]: any },
) {
    return request<API.BaseResponseLong_>('/api/sms/send?phoneOrEmail=' + phoneOrEmail, {
        method: 'GET',
        ...(options || {}),
    });
}

/** updateUser POST /api/user/update */
export async function updateUserUsingPOST(
    body: API.UserUpdateRequest,
    options?: { [key: string]: any },
) {
    return request<API.BaseResponseBoolean_>('/api/user/update', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
        },
        data: body,
        ...(options || {}),
    });
}

/** uploadFile GET /api/file/update */
export async function uploadFileUsingGET(
    params: API.FileChunkDTO,
    options?: { [p: string]: any },
) {
    return request<API.BaseResponseBoolean_>('/api/file/update', {
        method: 'GET',
        headers: {
            'Content-Type': 'multipart/form-data',
        },
        params,
        ...(options || {}),
    });
}


/** updateMyUser POST /api/user/update/my */
export async function updateMyUserUsingPOST(
    body: API.UserUpdateMyRequest,
    options?: { [key: string]: any },
) {
    return request<API.BaseResponseBoolean_>('/api/user/update/my', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
        },
        data: body,
        ...(options || {}),
    });
}

/** updateSecretKey POST /api/user/update/secret_key */
export async function updateSecretKeyUsingPOST(
    body: API.IdRequest,
    options?: { [key: string]: any },
) {
    return request<API.BaseResponseBoolean_>('/api/user/update/secretKey', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
        },
        data: body,
        ...(options || {}),
    });
}
